package behavioral.state;

public class GameBoss {

    private int attackTime;
    private IState state;

    public void go() {
        if (attackTime++ < 3) {
            if (state == null) {
                state = new SimpleState();
            }
        } else {
            state = new AngryState();
        }
        state.attack();
        state.defend();
    }

}
